<template>
    <a-drawer :visible="visible" :width="740" title="创建应用" ok-text="创建" :closable="false" @ok="onOk" @cancel="onCancel">
        <a-form :model="form">
            <a-form-item label="名称">
                <a-input v-model="form.name" placeholder="请输入应用名称" />
            </a-form-item>
            <a-form-item label="描述">
                <a-input v-model="form.description" placeholder="请输入应用描述信息" />
            </a-form-item>
        </a-form>
    </a-drawer>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import message from '@/utils/message'

const visible = ref(false)
const form = ref({
    name: '',
    description: ''
})

const onOk = () => {
    message.success('创建成功')
    visible.value = false
}

const onCancel = () => {
    visible.value = false
}

// 打开抽屉
const open = () => {
    visible.value = true
}

// 定义暴露
defineExpose({
    open
})
</script>

<style scoped></style>